﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebApiExtend
{
    /// <summary>
    /// 
    /// </summary>
    public class LogModel
    {
        /// <summary>
        /// 项目名称
        /// </summary>
        private string projectname { get; set; } = "pddFront";

        ///// <summary>
        ///// ltcid
        ///// </summary>
        //public string ltctraid { get; set; }

        ///// <summary>
        ///// requestid
        ///// </summary>
        //public string requestid { get; set; }

        ///// <summary>
        ///// 父级页面id
        ///// </summary>
        //public string requestpid { get; set; }


        /// <summary>
        /// 
        /// </summary>
        public string domain { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string requestraw { get; set; }

        ///// <summary>
        ///// 
        ///// </summary>
        //public string requesturl { get { return $"{domain}{requestraw}"; } }

        ///// <summary>
        ///// 
        ///// </summary>
        //public int? root { get; set; } = 0;

        /// <summary>
        /// 
        /// </summary>
        public string hostid
        {
            get
            {
                return "127.0.0.1:8005";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public string hostname
        {
            get
            {
                return "hostname";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public DateTime starttime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public DateTime endtime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string level { get; set; } = "INFO";

        /// <summary>
        /// 
        /// </summary>
        public string headers { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string body { get; set; }

        /// <summary>
        /// 自定义参数1-耗时
        /// </summary>
        public double haoshi { get { return Math.Round((this.endtime - this.starttime).TotalMilliseconds, 0); } }

        ///// <summary>
        ///// 返回结果 暂不需要 会暴漏敏感数据
        ///// </summary>
        //public string result { get; set; }
    }
}
